NULL,
G_TYPE_NONE, 0);
- /**
- * GtkFileChooser::file-activated:
- * @chooser: the object which received the signal.
- *
- * This signal is emitted when the user "activates" a file in the file
- * chooser. This can happen by double-clicking on a file in the file list, or
- * by pressing `Enter`.
- *
- * Normally you do not need to connect to this signal. It is used internally
- * by #GtkFileChooserDialog to know when to activate the default button in the
- * dialog.
- *
- * See also: gtk_file_chooser_get_file(), gtk_file_chooser_get_files()
- */
- g_signal_new (I_("file-activated"),
- iface_type,
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (GtkFileChooserIface, file_activated),
- NULL, NULL,
- NULL,
- G_TYPE_NONE, 0);
-
g_object_interface_install_property (iface,
g_param_spec_enum ("action",
P_("Action"),
int width,
int height,
int baseline);
-static void file_chooser_widget_file_activated (GtkFileChooser *chooser,
- GtkFileChooserDialog *dialog);
static void file_chooser_widget_response_requested (GtkWidget *widget,
GtkFileChooserDialog *dialog);
static void file_chooser_widget_selection_changed (GtkWidget *widget,
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserDialog, widget);
gtk_widget_class_bind_template_child_private (widget_class, GtkFileChooserDialog, buttons);
gtk_widget_class_bind_template_callback (widget_class, response_cb);
- gtk_widget_class_bind_template_callback (widget_class, file_chooser_widget_file_activated);
gtk_widget_class_bind_template_callback (widget_class, file_chooser_widget_response_requested);
gtk_widget_class_bind_template_callback (widget_class, file_chooser_widget_selection_changed);
}
response_id == GTK_RESPONSE_APPLY);
}
-/* Callback used when the user activates a file in the file chooser widget */
-static void
-file_chooser_widget_file_activated (GtkFileChooser *chooser,
- GtkFileChooserDialog *dialog)
-{
- gtk_widget_activate_default (GTK_WIDGET (chooser));
-}
-
static void
file_chooser_widget_selection_changed (GtkWidget *widget,
GtkFileChooserDialog *dialog)
* navigates in the dialog, including:
* * #GtkFileChooser::current-folder-changed
* * #GtkFileChooser::selection-changed
- * * #GtkFileChooser::file-activated
*
* You can also not use the methods that directly control user navigation:
* * gtk_file_chooser_unselect_filename()
gpointer data);
static void delegate_selection_changed (GtkFileChooser *chooser,
gpointer data);
-static void delegate_file_activated (GtkFileChooser *chooser,
- gpointer data);
static void delegate_add_choice (GtkFileChooser *chooser,
const char *id,
G_CALLBACK (delegate_current_folder_changed), receiver);
g_signal_connect (delegate, "selection-changed",
G_CALLBACK (delegate_selection_changed), receiver);
- g_signal_connect (delegate, "file-activated",
- G_CALLBACK (delegate_file_activated), receiver);
}
GQuark
g_signal_emit_by_name (data, "current-folder-changed");
}
-static void
-delegate_file_activated (GtkFileChooser *chooser,
- gpointer data)
-{
- g_signal_emit_by_name (data, "file-activated");
-}
-
GSettings *
_gtk_file_chooser_get_settings_for_widget (GtkWidget *widget)
{
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN ||
impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
- g_signal_emit_by_name (impl, "file-activated");
+ gtk_widget_activate_default (GTK_WIDGET (impl));
out:
<object class="GtkFileChooserWidget" id="widget">
<property name="hexpand">1</property>
<property name="vexpand">1</property>
- <signal name="file-activated" handler="file_chooser_widget_file_activated" swapped="no"/>
<signal name="response-requested" handler="file_chooser_widget_response_requested" swapped="no"/>
<signal name="selection-changed" handler="file_chooser_widget_selection_changed" swapped="no"/>
</object>
g_object_unref (filename);
}
-static void
-chooser_file_activated_cb (GtkFileChooser *chooser,
- gpointer user_data)
-{
- GFile *folder, *filename;
- char *folder_uri, *filename_uri;
-
- folder = gtk_file_chooser_get_current_folder (chooser);
- filename = gtk_file_chooser_get_file (chooser);
-
- folder_uri = g_file_get_uri (folder);
- filename_uri = g_file_get_uri (filename);
- g_message ("%s::file-activated\n\tFolder: `%s'\n\tFilename: `%s'\nDone.\n",
- G_OBJECT_TYPE_NAME (chooser), folder_uri, filename_uri);
- g_free (folder_uri);
- g_free (filename_uri);
-
- g_object_unref (folder);
- g_object_unref (filename);
-}
-
static void
add_new_filechooser_button (const gchar *mnemonic,
const gchar *chooser_title,
g_signal_connect (chooser, "current-folder-changed",
G_CALLBACK (chooser_current_folder_changed_cb), NULL);
g_signal_connect (chooser, "selection-changed", G_CALLBACK (chooser_selection_changed_cb), NULL);
- g_signal_connect (chooser, "file-activated", G_CALLBACK (chooser_file_activated_cb), NULL);
gtk_box_append (GTK_BOX (hbox), chooser);
button = gtk_button_new_with_label ("Tests");